module.exports = function (server) {
    const io = require('socket.io')(server)
    io.on('connection', function (socket) {
        const id = socket.id
        console.log(id)
        socket.on('disconnect',function(){
            console.log('离开')
        })
        socket.on('send', function (data) {
            console.log(data)
            io.sockets.emit('receive', '你哈')
        })
    })
}